package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.RukuItemSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.RukuItemSL;

@Component
public class RukuItemSLConverter extends AbstractConverter<RukuItemSL, RukuItemSLDTO> {

    @Override
    public RukuItemSL toModel(final RukuItemSLDTO dto) {
        final RukuItemSL model = new RukuItemSL();

        model.setTypeCode(dto.getTypeCode());
        model.setTypeName(dto.getTypeName());
        model.setProductName(dto.getProductName());
        model.setSpecification(dto.getSpecification());
        model.setMoney(dto.getMoney());
        model.setCount(dto.getCount());
        model.setAmount(dto.getAmount());
        model.setDescription(dto.getDescription());
        model.setItemId(dto.getItemId());
        model.setBrand(dto.getBrand());
        return model;
    }

    @Override
    public RukuItemSLDTO toDTO(final RukuItemSL model, final boolean forListView) {
        final RukuItemSLDTO dto = new RukuItemSLDTO();

        dto.setId(model.getId());
        dto.setTypeCode(model.getTypeCode());
        dto.setTypeName(model.getTypeName());
        dto.setProductName(model.getProductName());
        dto.setSpecification(model.getSpecification());
        dto.setMoney(model.getMoney());
        dto.setCount(model.getCount());
        dto.setAmount(model.getAmount());
        dto.setDescription(model.getDescription());
        dto.setItemId(model.getItemId());
        dto.setBrand(model.getBrand());
        return dto;
    }

}
